home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_div.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-28  |  3.3 KB  |  80 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="400" height="250" caption="Block">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <label name="lblAlign" caption="Align" hint="Choose how the block should be aligned." width="42" height="13" top="8" left="8"/>
  6.             <combobox name="comAlign" taborder="0" text="" hint="Choose how the block should be aligned." width="360" height="21" top="24" left="8">
  7.                 <items>
  8.                 left
  9.                 center
  10.                 right
  11.                 justify
  12.                 </items>
  13.             </combobox>
  14.         </panel>
  15.     </controls>
  16.     <dialogevents>
  17.         <event type="onclose" resulttype="ok">
  18.             StartCode := '<div';
  19.              If comAlign.Text <> '' then
  20.                StartCode := StartCode + (' align="'+(comAlign.Text)+'"');        
  21.               If edtCSSClass.Text <> '' then
  22.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  23.               If edtCSSId.Text <> '' then
  24.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  25.               If edtCSSStyle.Text <> '' then
  26.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  27.             for i := 0 to EventGrid.Count - 1 do
  28.               begin
  29.               if EventGrid.Rows[i].EditText <> '' then
  30.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  31.              end;  
  32.             StartCode := StartCode + '>'; 
  33.             EndCode := '</div>';
  34.             If cbMakeXHTMLCompliant.Checked then
  35.              StartCode := MakeXHTMLCompliant(StartCode, true);             
  36.             If cbDoPHPEscape.Checked then
  37.              StartCode := DoPHPEscape(StartCode);
  38.             // A little "hack" - WebCoder will set this, to let us know whether to update
  39.             // an existing tag, or insert a brand new one
  40.             If cbUpdateExistingTag.Checked then 
  41.              ReplaceTag(StartCode)
  42.             else 
  43.                InsertTags(StartCode, EndCode);   
  44.               
  45.         </event>
  46.         <event type="onshow">    
  47.             // Lets put the advanced panel in the right place
  48.             pnlAdvanced.Parent := MainPanel;
  49.             pnlAdvanced.Left := 8;
  50.             pnlAdvanced.Top := MainPanel.Height - 32;        
  51.             pnlAdvanced.Width := Self.Width - 36;
  52.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  53.             If pnlAdvanced.Height > 20 then
  54.              Self.Height := Self.Height + 200;
  55.             Self.ActiveControl := MainPanel;
  56.             MainPanel.SetFocus; 
  57.         </event>
  58.         <event type="updatedialog">
  59.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  60.             // The entire selected tag will be passed as a parameter to this function, that should update
  61.             // the required fields of the dialog.
  62.             function UpdateDialog(Tag: string);
  63.              begin
  64.               comAlign.Text := GetValueFromAttribute(Tag, 'align');
  65.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  66.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  67.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  68.               for i := 0 to EventGrid.Count - 1 do
  69.                 begin
  70.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  71.                  If EventVal <> '' then
  72.                   EventGrid.Rows[i].EditText := EventVal;
  73.                end;      
  74.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  75.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                        
  76.              end;
  77.         </event>
  78.     </dialogevents>
  79. </dialog>
  80.